package main

const base int = 3

func largeGroupPositions(s string) [][]int {
	width := 1
	var res [][]int
	for i := range s {
		if i == len(s)-1 || s[i] != s[i+1] {
			if width >= base {
				res = append(res, []int{i - width + 1, i})
			}
			width = 1
		} else {
			width++
		}
	}
	return res
}
